﻿<%@ Page Language="C#" MasterPageFile="~/MainMaster.Master" AutoEventWireup="true" CodeBehind="TreeConfig.aspx.cs" Inherits="Mang24k99.Web.TreeView.TreeConfig"
     Title="树结构数据表配置" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="Panel1" runat="server">
        <asp:Button ID="btnBack" runat="server" CssClass="form_btn" Text="返回上一页" 
            onclick="btnBack_Click" />
    </asp:Panel>
    <table width="100%">
        <tr >
            <td class="tb_title1" style="width:20%;">树名</td>
            <td class="tb_txt1" style="width:auto">
                <asp:TextBox ID="txtTreeName" runat="server" Width="50%" MaxLength="60"></asp:TextBox><div class='msg'><span style='color:red'>*</span>限60字符</div></td>
                <asp:TextBox ID="txtTreeNO" runat="server" CssClass="hidden"></asp:TextBox>
        </tr>
        <tr>
            <td class="tb_title1">绑定表名</td>
            <td class="tb_txt1">
                <asp:DropDownList ID="ddlObj" runat="server" AutoPostBack="true" 
                        onselectedindexchanged="ddlObj_SelectedIndexChanged">
                    </asp:DropDownList></td>
        </tr>
        <tr>
            <td class="tb_title1">Text字段</td>
            <td class="tb_txt1">
                <asp:DropDownList ID="ddlTextField" runat="server" >
                    </asp:DropDownList></td>
        </tr>
        <tr>
            <td class="tb_title1">Value字段</td>
            <td class="tb_txt1">
                <asp:DropDownList ID="ddlValueField" runat="server" >
                    </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="tb_title1">是否有效</td>
            <td class="tb_txt1">
                <asp:DropDownList ID="ddlIsValidate" runat="server">
                    <asp:ListItem Selected="True" Value="1">使用</asp:ListItem>
                    <asp:ListItem Value="0">禁用</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btnSave" runat="server"  CssClass="form_btn" Text="新增" 
                    onclick="btnSave_Click" />&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="btnCancel" runat="server" CssClass="form_btn" Text="取消" 
                    onclick="btnCancel_Click" />
            </td>
        </tr>
    </table>
    <asp:Panel ID="Panel2" runat="server">
         <div>
            <asp:GridView ID="grdList" runat="server"  AutoGenerateColumns="False" 
                Width="100%" onrowcommand="grdList_RowCommand">
                <HeaderStyle CssClass="tb_title2" />
                <RowStyle CssClass="tb_txt2" />
                 <Columns>
                    <asp:TemplateField HeaderText="序号">
                        <ItemTemplate>
                            <%#Container.DataItemIndex+1%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="TreeNO" HeaderText="编号" />
                    <asp:BoundField DataField="TreeName" HeaderText="树名" />
                    <asp:TemplateField HeaderText=" 绑定表名称">
                          <ItemTemplate>
                                <asp:Label ID="lbname" runat="server" Text='<%#SubString((string)Eval("TableName")) %>'></asp:Label>
                          </ItemTemplate>  
                    </asp:TemplateField>
                    <asp:BoundField DataField="DisfiledName" HeaderText="Text字段" />
                    <asp:BoundField DataField="FilednoName" HeaderText="Value字段" />
                    <asp:TemplateField HeaderText="是否有效">
                        <ItemTemplate>
                            <asp:Label ID="lb" runat="server" Text='<%#GetStatus((int)Eval("IsValidate"))%>'>></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="条件配置">
                        <ItemTemplate>
                            <a href="TreeCondition.aspx?no=<%# Eval("TreeNO")%>">条件配置</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="右键菜单配置">
                        <ItemTemplate>
                            <a href="TreeMenu.aspx?no=<%# Eval("TreeNO")%>">右键菜单配置</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="修改">
                        <ItemTemplate>
                            <asp:LinkButton ID="lkbtnEdit" runat="server" CommandName="Modi" 
                                CommandArgument='<%# Eval("TreeNO")%>'>修改
                            </asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="删除">
                        <ItemTemplate>
                            <asp:LinkButton ID="lkbtnDel" runat="server" CommandName="Del" 
                                    OnClientClick="return confirm('确定要删除吗？')" CommandArgument='<%# Eval("TreeNO")%>'>删除
                            </asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>   
    </asp:Panel>
</asp:Content>
